package com.onjob.employment;

import java.util.Date;
import java.util.List;

import org.hibernate.Query;

import util.dao.HibernateDaoImpl;

public class ResumeDaoImpl extends HibernateDaoImpl<Resume, String> implements
		ResumeDao {

	@Override
	public List<Resume> findAllResumes(String personInfoid) {
		Query  query = this.getSession().createQuery(
				" from " + Resume.class.getName()
						+ " r where r.personInfo=:personInfoid");
		query.setString("personInfoid", personInfoid);
		return query.list();
	}

	@Override
	public Resume findResumeByType(String string,String type) {
		Query query = this.getSession().createQuery(
				" from " + Resume.class.getName() + " p where p."+type+"=:type");
		query.setString("type", string);
		
		return (Resume) query.uniqueResult();
	}

	

}
